package il.ac.braude.sona.gui.forms.myforms;

import il.ac.braude.sona.constants.ButtonPermission;
import il.ac.braude.sona.constants.Resources;
import il.ac.braude.sona.gui.forms.FormFrame;
import il.ac.braude.sona.gui.forms.FormPanel;
import il.ac.braude.sona.gui.forms.questions.QButton;
import il.ac.braude.sona.gui.forms.questions.QComboBox;
import il.ac.braude.sona.gui.forms.questions.QTextField;

import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.JLabel;
/**
 * The ManagementAndRegistrationForm class contains methods that create the GUI for appoint management and adding new user to system
 * @author  Ofek Ron
 * @author Avihay Avitan
 * @author Nitzan Inbar
 * @author Sasha Rozenthal
 * Laboratory in Software Engineering,Ort Braude College.</p>
 *
 */
public class ManagementAndRegistrationForm extends FormFrame {
	/**
	 * Creates the form to replace management members
	 * @param workers - the current management members
	 * @param buttoncontroll - action lisitner for new user button
	 */
	public ManagementAndRegistrationForm(ArrayList<String> workers,ActionListener buttoncontroll) {
		super(ButtonPermission.ManagementRegistration, Resources.Strings.Submit);
		FormPanel form = new FormPanel();
		form.addTitleWithUnderline("Management appoitment and registration");
		form.addQuestion(new QComboBox("Choose Supervisor:",workers.toArray(new String[workers.size()])));
		form.addQuestion(new QComboBox("Choose Board Chairman:",workers.toArray(new String[workers.size()])));
		form.addQuestion(new QComboBox("Choose Board Member:",workers.toArray(new String[workers.size()])));
		form.addQuestion(new QComboBox("Choose Board Member:",workers.toArray(new String[workers.size()])));
		form.addQuestion(new QButton("Register new user to system", buttoncontroll));
		setFormPanel(form);
	}
	/**
	 * Creates the form to add new worker to system
	 */
	public ManagementAndRegistrationForm() {
		super("Register new user", Resources.Strings.Submit);
		FormPanel form = new FormPanel();
		form.addTitleWithUnderline("New user registration");
		form.addQuestion(new QTextField("UserName:"));
		form.addQuestion(new QTextField("Password:"));
		form.addQuestion(new QTextField("First name:"));
		form.addQuestion(new QTextField("Last name"));
		form.addQuestion(new QTextField("Email:"));
		form.addQuestion(new QComboBox("User type:",new String[]{"worker"}));//can add also student and lecturer if needed
		setFormPanel(form);
	}
	


	

}
